package com.example.exercise.analysis.dataview.controller;

import com.example.exercise.core.annotations.NotAutoLog;
import com.example.exercise.core.base.dto.BaseResponse;
import com.example.exercise.analysis.dataview.response.AppChannelCount;
import com.example.exercise.analysis.dataview.service.AppRecordCountService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 添加测试数据，对于月活跃，一个月去重后的数据放一个表
 */
@RestController
@RequestMapping("/rest/appRecordCount")
//@Api(description = "查询app使用情况的数据")
public class AppRecordCountController {

    @Resource
    private AppRecordCountService viewService;

    @NotAutoLog()
    @RequestMapping(value = "/getActiveCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiOperation(value = "查询活跃设备数", notes = "查询活跃设备数")
    public BaseResponse<Object> getActiveCount(String[] appVersions) {
        BaseResponse<Object> baseResponse = new BaseResponse<>();
        List<AppChannelCount> list = viewService.getActiveCount(appVersions);
        baseResponse.ok(list);
        return baseResponse;
    }

}
